package com.wu.conf;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 虚拟路径向绝对路径映射，解决上传图片后使用路径获取图片需重启服务器问题
 */
@Configuration
public class MyPicConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("file:E:\\ENV\\git\\springboot-shiro-redis-vue\\Item-springboot\\qs-api\\src\\main\\resources\\static\\");
    }
}
